dxp-ux

(0 reviews)

POST Prepay-Topup Balance (TMF-654)

The createTopupBalance API provides

Below features for PR:

  1. createTopupBalance: allows the customer to top up their account with a mobile number that they have specified (MSISDN) or subscriptionId.
  2. Retrieve Tax Info: API returns the estimated tax amount before making the top-up if we call API with field reason = TAX. Below features for PR:

Below features for PA:

  1. createTopupBalance: allows the customer to top up their account with a specified MSISDN. The topup can be performed using either voucher or voucherless method.

URL

http://[localhost]:[port]/dxp-ux/v1/{businessId}/topupBalance

URL PARAMS

nametypedescriptionrequired
businessIdstring2 letter ISO 3166 country code (TT, BB, JM, PA, PR etc.) identifying the business unit.Y

Headers

namevaluedescriptionrequired (mandatory-Y, optional-N, Not applicable- N/A)
client_idstringThe client_id identifying the channel. Minimum characters: 5Y(PR,PA)
client_secretstringPassword associated with the client_id. Minimum characters: 5Y(PR,PA)
lobstringThe Line of Business Identifier currently available are: FIXED PREPAID POSTPAIDN(PR),N/A(PA)
channeIdstringChannel to business: Allowed value: APP (SupperApp), Qpay (RT2)Y(PR),N/A(PA)
X-Correlation-IDstringIdentifier that correlates HTTP request between a client and server. Any identification model (UUDI, checksum, etc.) can be used, as long as it is a unique value to differentiate a transaction.Y(PR,PA)
targetSystemstringThis describes the target system. โ€œMatrixxโ€ is in scope.Y(PR),N/A(PA)

Data Model - Request

namevaluedescriptionrequired (mandatory-Y, optional-N, Not applicable- N/A)
idstringThe unique order id used in the authorise or settlement request. This can be used to track the transaction and aids duplicate checking.
Example : OrderId of the transaction. Should be alpha numeric value without colons (sample: "ABC12345")
Y (PR) , N/A (PA)
amountobjectIndicate the amount on the bucketY (PR , PA)
amount.amountnumberUnit number, the amount that you are doing recharge to customerY (PR, PA)
amount.unitsstringCurrency (ISO4217 norm uses 3 letters to define the currency)N (PR) , Y(PA)
voucherstringIdentifier for a voucher when the topup can be performed by this means
Note for PR: Voucher is mandatory field we should have to any random value or null , to obtain tax details before paying for the topup
Y (PR , PA)
reasonstringthe reason for the action/task
Note for PR: The "reason" field it should have to passed as (tax, estimate, tax estimate) and the voucher field is passed as null or random values, to obtain tax details before paying for the topup
Y (PR) , N/A (PA)
product[]array of objectA reference to the Product associated with this bucketY(PR) , N/A (PA)
product[].idstringno significance required field in raml , but we are not passing any value we are passing as empty stringY(PR) , N/A (PA)
product[].namestringName of the related entity,it is a product name recharge offer name ,it is hardcoded valueY(PR) , N/A (PA)
product[].'@type'stringit is a offer type , it is hardcoded valueY(PR) , N/A (PA)
relatedParty[]array of objectUsed to provide information about any other entity with relation to the operation,
Please refer below relatedParty Table for more details
Y(PR) , N/A (PA)
relatedParty[].idstringUnique identifier of a related entity.Y(PR) , N/A (PA)
relatedParty[].'@type'stringWhen sub-classing, this defines the sub-class Extensible nameY(PR) , N/A (PA)
partyAccountobjectPartyAccount reference. A party account is an arrangement that a party has with an enterprise that provides products to the party.Y (PR) , N/A(PA)
partyAccount.idstringCustomer Mobile NumberY (PR) , N/A(PA)
partyAccount.'@type'stringWhen sub-classing, this defines the sub-class entity name of partyAccount,
In this case either MSISDN/SubscriptionId
Y (PR) , N/A (PA)
bucketobjectlink to the resource that holds bucket informationN/A (PR) ,Y(PA)
bucket.idstringunique identifier of bucketN/A (PR) ,Y(PA)
paymentMethodobjectA payment method defines a specific mean of paymentN/A (PR) ,Y(PA)
paymentMethod.idstringUnique id for auditing and identifying duplicate transactionsN/A (PR) ,Y(PA)
usageTypestringdefines the type of the underlying Balance.N/A (PR) ,Y (PA)
channelobjectThe channel to which the resource referenceN/A (PR) ,Y(PA)
channel.idstringunique identifier of the channelN/A (PR) ,Y(PA)
channel.namestringName of the channelN/A (PR) ,Y(PA)
channel.hrefstringHyperlink reference of channelN/A (PR) ,N(PA)
product subResource -Data Model
@typevaluedescriptionrequired (mandatory-Y, optional-N, Not applicable- N/A)examples
OfferstringThis indicates the offer being applied.Y(PR)PR:
{"id": "01",
"name":"RechargeOffer",
"@type": "Offer" }
relatedParty subResource -Data Model
@typevaluedescriptionrequired (mandatory-Y, optional-N, Not applicable- N/A)examples
PaymentGatewayUserIdstringIdentifier for the customer id on the payment gateway, "BRAIN TREE".Y(PR)PR:
{"id": "628935575", "@type": "PaymentGatewayUserId" }
PaymentGatewayIdstringIdentifier for the specific payment gateway. If not supplied, the default payment gateway will be used."Y(PR)PR:
{"id": "0","@type": "PaymentGatewayId" }

Data Model Response

namevaluedescriptionrequired (mandatory-Y, optional-N, Not applicable- N/A)
idstringThe unique id used in the authorise or settlement request. This can be used to track the transaction and aids duplicate checkingN (PR), Y(PA)
hrefstringA reference to the resourceN/A (PR),Y(PA)
confirmationDatedatetimewhen the deduction was confirmed in the serverN (PR), N/A (PA)
statusstringStatus of the operationN (PR), Y(PA)
amountobjectAn amount in a given unitN (PR), Y(PA)
amount.amountnumberThe amount that you are doing recharge to customerN (PR), Y(PA)
amount.unitsstringCurrency (ISO4217 norm uses 3 letters to define the currency)N (PR), Y(PA)
voucherstringAfter successful Payment, "BRAIN TREE" will send encrypted transaction code/one time codeN (PR), N/A (PA)
reasonstringText describing the reason for the action/taskN (PR), Y(PA)
product[]array of objectA reference to the Product associated with this bucketN (PR), N/A (PA)
product[].idstringno significance required field in raml , but we are not passing any value we are passing as empty stringN (PR), N/A (PA)
product[].namestringName of the related entity,it is a product name recharge offer name ,it is hardcoded valueN (PR), N/A (PA)
product[].'@type'stringIt represents is a offer type , it is hardcoded valueN (PR), N/A (PA)
validForobjectA period of time, either as a deadline (endDateTime only) a startDateTime only, or bothN (PR), Y(PA)
validFor.endDateTimedatetimeEnd of the time periodN (PR), Y(PA)
validFor.startDateTimedatetimeStart of the time period. If you define a start, you must also define an endN (PR)
relatedParty[]array of objectUsed to provide information about any other entity with relation to the operation, Please refer below relatedParty Table for more detailsN (PR), N/A (PA)
relatedParty[].idstringUnique identifier of a related entity.N (PR), N/A (PA)
relatedParty[].'@type'stringWhen sub-classing, this defines the sub-class Extensible nameN (PR), N/A (PA)
bucketobjectlink to the resource that holds bucket informationN (PR), Y(PA)
bucket.idstringunique identifier
Note for PR:Name of the related entity. Identify the account type example :Prepaid
N (PR), Y(PA)
bucket.hrefstringHyperlink reference of bucketN/A (PR),Y(PA)
bucket.namestringName of the related entity.N (PR) , N/A (PA)
impactedBucket[]array of objectA resource that references other buckets that have been impacted by the action of type TopupBalance,AdjustBalance,TransferBalance or ReserveBalance
Note for PR: Tax information
N (PR) , Y (PA)
impactedBucket[].amountAfternumber | objectIndicates the amount after on the impacted bucket after the action has completed
Note:
For PA, this field is object
For PR, this field is number and is the total amount that you are paying for topup with Tax includes
N (PR) , Y (PA)
impactedBucket[].namestringName of the impactedBucket.N (PR) , N/A (PA)
impactedBucket[].item[]array of objectArray of items in impactedBucket.N (PR) , N/A (PA)
impactedBucket[].item[].amountintegerAmount paying for STATE SALES TAX and CITY SALES TAXN (PR) , N/A (PA)
impactedBucket[].item[].namestringName related to STATE SALES TAX and CITY SALES TAXN (PR) , N/A (PA)
impactedBucket[].amountAfter.amountnumberNumeric value in a given unitN/A (PR), Y(PA)
impactedBucket[].amountAfter.unitsstringUnit for the amountN/A (PR), Y(PA)
impactedBucket[].amountBeforeobjectIndicates the amount remaining on the impacted bucketN/A (PR), Y(PA)
impactedBucket[].amountBefore.amountnumberNumeric value in a given unitN/A (PR), Y(PA)
impactedBucket[].amountBefore.unitsstringUnit for the amountN/A (PR), Y(PA)
partyAccountobjectPartyAccount reference. A party account is an arrangement that a party has with an enterprise that provides products to the party.N (PR) , N/A (PA)
partyAccount.idstringCustomer Mobile NumberN (PR) , N/A (PA)
partyAccount.'@type'stringWhen sub-classing, this defines the sub-class entity name of partyAccount, In this case either MSISDN/SubscriptionIdN (PR) , N/A (PA)
channelobjectThe channel to which the resource reference toN/A (PR), Y(PA)
channel.idstringunique identifier of channelN/A (PR), Y(PA)
channel.hrefstringHyperlink referenceN/A (PR), Y(PA)
channel.namestringName of the channel.N/A (PR), Y(PA)
requestedDatedatetimeDate when the deduction request was received in the serverN/A (PR), Y(PA)
product subResource -Data Model
@typevaluedescriptionrequired (mandatory-Y, optional-N, Not applicable- N/A)examples
OfferstringRecharge OfferN(PR)PR:
{"id": "01",
"name": "RechargeOffer", "@type": "Offer" }
impactBucket subResource - Data Model
fieldvaluedescriptionrequired (mandatory-Y, optional-N, Not applicable- N/A)examples
amountAfternumber| objectIndicates the amount after on the impacted bucket after the action has completed
Note:
For PA, this field is object
For PR, this field is number and is the total amount that you are paying for topup with Tax includes
N(PR) , Y(PA)PR: 111.5
PA: {"amount": 1167.55, "units": "USD"}
amountBeforeobjectamount before the topupN/A (PR), Y(PA)PA: { "amount": 1161.92, "units": "USD"}
namestringname to identify the bucketN(PR)PR: "Total Amount"
item[]arrayA resource used by the ImpactedBucket resource to capture the impact of a ImpactedBucketN (PR)PR:
[{"amount": 10.5,
"name": "STATE SALES TAX"
},
{"amount": 1.0,
"name": "CITY SALES TAX"
}]
impactedBucket.item subResource -Data Model
namevaluedescriptionrequired (mandatory-Y, optional-N, Not applicable- N/A)examples
STATE SALES TAXstringAmount paying for STATE SALES TAXN(PR)PR:
{ "amount": 10.5, "name": "STATE SALES TAX" }
CITY SALES TAXstringAmount paying for CITY SALES TAXN(PR)PR:
{"amount": 1.0, "name": "CITY SALES TAX" }
relatedParty subResource -Data Model
@typevaluedescriptionrequired (mandatory-Y, optional-N, Not applicable- N/A)example
PaymentGatewayUserIdstringPayment gate way user id; will get this info from "BRAIN TREE".N(PR)PR:
{"id": "628935575", "@type": "PaymentGatewayUserId" }
PaymentGatewayIdstringIdentifier for the specific payment gateway. If not supplied, the default payment gateway will be used here default gateway is "BRAIN TREE".N(PR)PR:
{"id": "0","@type": "PaymentGatewayId" }
PaymentResourceIdRefstringPayment resource idN(PR)PR:
{ "id": "70", "@type": "PaymentResourceIdRef" }
Key considerations
PA Implementation
1. This is implemented for prepaid customers.
2. Top-up is done through the Ericsson system and can be performed in two ways:
   - Voucher
   - Voucherless
3. For voucher-based top-up, the following fields are mandatory in the request:
   - bucket.id: This is the service number or MSISDN.
   - voucher: A valid voucher must be provided and currently the maximum expected length is 16 characters.
   - paymentMethod.id: A unique ID used for auditing and identifying duplicate transactions.
   - channel.name, channel.id: Specific to each payment gateway.
   - amount: As per RAML, this field is mandatory, so it must be passed as 0.0.
   - usageType: This should always be "monetary".
4. For voucherless top-up, the following fields are mandatory in the request:
   - bucket.id: This is the service number or MSISDN.
   - paymentMethod.id: This should be the transaction ID received after successful payment with the payment gateway.
   - channel.name, channel.id: Specific to each payment gateway.
   - amount: The amount chosen by the customer.
   - usageType: This should always be "monetary".
5. For each top-up, X-correlation-ID and paymentMethod.id should be unique.
6. The voucher field is not applicable for voucherless top-up use case requests.
7. For all the dateTime fields
  - Any datetime before 1908-04-22 will show offset -05:18
  - Any datetime on or after 1908-04-22 will show offset -05:00
PR Implementation
1. For TAX_INFORMATION Request:
 - The possible values of reason attributes are "TAX/ESTIMATE/TAX ESTIMATE"
 - No need to pass valid voucher (one time code/nonce) code, it will accept any dummy value.
 - id field is not applicable for Tax information using subscriptionId usecase .
 - relatedParty array and its fields are not applicable.

2. For TOPUP BALANCE Request:
 - No need to pass reason attribute.
 -  Expecting valid voucher (onetime code/nonce) code for complete top-up balance.
 - id ,  partyAccount.'@type', product array and its fields are optional.
 - reason field is not applicable.

3. For TAX_INFORMATION Response:
 -  "id" field is not applicable for Tax information using subscriptionId usecase .
 -  "confirmationDate" , relatedParty[] array and its fields are not applicable.

4. For TOPUP BALANCE Response:
 - "reason" field is not applicable.
Possible Error Scenarios for PR :
IF WE ARE PASSING INVALID (MSISDN) NUMBER IN REQUEST BODY
{
    "errors": [
        {
            "code": 400,
            "message": "MATRIXX:POST_TOPUP_BALANCE",
            "description": "11 | Subscriber not found (AccessNumber=709565949)"
        }
    ]
}
IF WE ARE PASSING INVALID VOUCHER IN REQUEST BODY
{
    "errors": [
        {
            "code": 400,
            "message": "MATRIXX:POST_TOPUP_BALANCE",
            "description": "52 | The AUTHORIZATION_AND_SETTLEMENT Request to Braintree has Failed: Invalid Payment Method Nonce QWEDRFRG"
        }
    ]
}
IF WE ARE PASSING INVALID PAYMENT Gateway ID REQUEST BODY
{
    "errors": [
        {
            "code": 400,
            "message": "MATRIXX:POST_TOPUP_BALANCE",
            "description": "52 | No Payment Gateway with Id 3 has been configured"
        }
    ]
}

Reviews